int* singleNumber(int* nums, int numsSize, int* returnSize) {

    int* ans = calloc(2, sizeof(int));
    int ret = 0;
    int i = 0;
    for (i = 0; i < numsSize; i++) {
        ret ^= nums[i];
    } 
    
    int pos = 0;
    for (i = 0; i < 32; i++) {
        if (((ret >> i) & 1) == 1) {
            pos = i;
            break;
        }
    }
    for (i = 0; i < numsSize; i++) {    
        if (((nums[i] >> pos) & 1) == 1) {
            ans[0] ^= nums[i];
        }
        else {
            ans[1] ^= nums[i];
        }
    }
    *returnSize = 2;
    return ans;
}